﻿using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Resources;

using Game.Common;
using Game.Toolkit.Internal;
using System.Windows.Media;
using System.Windows.Media.Imaging;

namespace Game.Toolkit.Internal
{
    static class MountainResourceFile
    {

        public static BitmapImage North 
        {
            get { return GetImage("obj_mountain_1_north"); }
        }

        public static BitmapImage NorthEast
        {
            get { return GetImage("obj_mountain_1_north_east"); }
        }

        public static BitmapImage NorthWest
        {
            get { return GetImage("obj_mountain_1_north_west"); }
        }

        public static BitmapImage South
        {
            get { return GetImage("obj_mountain_1_south"); }
        }

        public static BitmapImage SouthEast
        {
            get { return GetImage("obj_mountain_1_south_east"); }
        }

        public static BitmapImage SouthWest
        {
            get { return GetImage("obj_mountain_1_south_west"); }
        }

        public static BitmapImage Peak
        {
            get { return GetImage("obj_mountain_1_peak"); }
        }

        public static BitmapImage GetImage(string name)
        {
            BitmapImage image = new BitmapImage();
            string uri = 
                @"Game.Toolkit.Resources.Hills."
                + name + ".png";
            Assembly a = Assembly.GetExecutingAssembly();
            Stream stream = a.GetManifestResourceStream(uri);
            image.BeginInit();
            image.StreamSource = stream;
            image.EndInit();
            
            return image;
        }
    }
}
